package com.xiaomaoguai.eventbus.multi;

import org.junit.Test;

import com.google.common.eventbus.EventBus;

/**
 * @Description :
 * @FileName: MultiEventBus.java
 * @Author :WeiHui.Zhang
 * @Data : 2015年6月18日 下午3:11:59
 * @Version:V1.00
 */
public class MultiEventBus {

	@Test
	public void testReceiveEvent() throws Exception {
		EventBus eventBus = new EventBus("test");

		MultipleListener listener = new MultipleListener();
		eventBus.register(listener);

		eventBus.post(new Integer(100));
		eventBus.post(new Integer(200));
		eventBus.post(new Integer(500));

		eventBus.post(new Long(1000));
		eventBus.post(new Long(10000));

		System.out.println("LastMessage:" + listener.getLastInteger());
		System.out.println("LastMessage:" + listener.getLastLong());
	}
}
